











<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
function find(a,str) {
 var obj = {}
   var r1 = str.split("&")
   for (var i = 0; i < r1.length; i++) {
    var item = r1[i]
var tmp = item.split('=')
 var key = tmp[0]
   var value = tmp[1]
     obj[key] = value
      }
    return obj[a]
   }
   var search = 'name1=value1&name2=value2&name3=value3&name4=value4&name5=value5';
    var res = find('name4',search)
    console.log(res)



    </script>






</body>
</html>